#! /usr/bin/env bash

set -e
set -x
set -o pipefail

# Make sure we use ASCII based sorting and comparisons, not whatever local is
# used on the system
unset LANG LC_COLLATE
export LC_ALL=C

VERSION=@VERSION@
BUILD=@BUILDDIR@
SRC=@SRCDIR@
SAMTOOLS=@SAMTOOLS@

SCRIPT=$1

# Path to data
D=$BUILD/tests/data
PATH=${BUILD}:${BUILD}/tests:${SRC}/tests:$PATH

# Name
N=$(basename $1 .sh)
# Working directory
WORKDIR=tests/$N
mkdir -p $WORKDIR

SCRIPT=$(realpath $SCRIPT)
cd $WORKDIR
source "$SCRIPT"
